From: Colin Walters Date: Tue, 2 Oct 2018 15:47:48 +0000 (-0400) Subject: rofiles-fuse: Improve error message for failure to open root X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2~19^2~13 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=04aff9c1c022e70ec46597bbb48c4ecfd103b50c;p=ostree.git rofiles-fuse: Improve error message for failure to open root I was debugging some rpm-ostree work and saw: `openat: No such file or directory` and it wasn't immediately obvious it was stderr from `rofiles-fuse`. Use the `err` API which is better in many ways; in this case it automatically prefixes with `argv0`. Closes: #1747 Approved by: jlebon --- diff --git a/src/rofiles-fuse/main.c b/src/rofiles-fuse/main.c index fd16e29b..4033caa4 100644 --- a/src/rofiles-fuse/main.c +++ b/src/rofiles-fuse/main.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -628,10 +629,7 @@ rofs_parse_opt (void *data, const char *arg, int key, { basefd = openat (AT_FDCWD, arg, O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC | O_NOCTTY); if (basefd == -1) - { - perror ("openat"); - exit (EXIT_FAILURE); - } + err (1, "opening rootfs %s", arg); return 0; } else